package com.yenlien.traceyun.breed.dao;

import com.yenlien.traceyun.breed.entity.BreedInputs;
import com.yenlien.traceyun.webase.dao.BaseJpaDao;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Created by LiuSha on 2020/9/22.
 */
public interface BreedInputsDao extends BaseJpaDao<BreedInputs> {
    BreedInputs findById(String id);

    @Query(value = "select b.inputsName from BreedInputs b where b.companyId=?1 group by b.inputsName")
    List<String> findByAll(String companyId);

    @Query(value = "select b from BreedInputs b where b.inputsName=?1 and b.companyId=?2 ")
    List<BreedInputs> findByInputsName(String inputsName, String companyId);

    @Query(value = "select b.inputsName from BreedInputs b where b.type=?1 and b.companyId=?2 ")
    List<String> findByType(String type, String companyId);

    @Query(value = "select b from BreedInputs b where b.type=?1 and b.companyId=?2 ")
    List<BreedInputs> findInputsByType(String type, String companyId);
}
